package com.techsoul.admin.controller;

import com.techsoul.admin.service.IHomeService;
import com.techsoul.common.core.pojo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页 控制器
 *
 * @author liuen
 */
@Api(tags = "首页")
@RestController
@RequestMapping("/api/home")
public class SingleHomeController {

    @Autowired
    private Result result;

    @Autowired
    private IHomeService homeService;

    @ApiOperation("导航栏")
    @PostMapping("/navbar")
    public Result getNavbars() {
        return result.success(homeService.getNavbars());
    }

    @ApiOperation("首页轮播图")
    @PostMapping("/banner")
    public Result getBanners() {
        return result.success(homeService.getBanners());
    }

    @ApiOperation("首页活动板块")
    @PostMapping("/panel")
    public Result getPanels() {
        return result.success(homeService.getPanels());
    }

}
